package cz.martindobias.aladin;

import android.net.Uri;

import java.util.HashSet;
import java.util.Set;

public abstract class ContentTables {
    public static final String AUTHORITY = "aladin.chmu.cz";

    public static final String COLUMN_URI = "uri";
    public static final String COLUMN_RESULT = "result";
    public static final String COLUMN_TIMESTAMP = "timestamp";
    public static final String COLUMN_RESULT_TYPE = "type";
    public static final String COLUMN_SEQUENCE = "sequence";

    public static final String BASE_CONTENT_URI_STRING = "content://" + AUTHORITY;
    public static final Uri BASE_CONTENT_URI = Uri.parse(BASE_CONTENT_URI_STRING);

    public static final Set<String> CATEGORIES;

    static {
        CATEGORIES = new HashSet<String>();
        CATEGORIES.add(AladinTable.CATEGORY_TEMPERATURE);
        CATEGORIES.add(AladinTable.CATEGORY_PRECIPITATION);
        CATEGORIES.add(AladinTable.CATEGORY_WIND);
        CATEGORIES.add(AladinTable.CATEGORY_NEBULAE);
        CATEGORIES.add(PrebaTable.CATEGORY_PREBA);
        CATEGORIES.add(RadarTable.CATEGORY_RADAR);
        CATEGORIES.add(VisirTable.CATEGORY_VISIR);
        CATEGORIES.add(PPTable.CATEGORY_PP);
    }

    public static interface ForecastTable {
        public static final String RESOURCE = "forecast";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/" + RESOURCE;
        public static final Uri CONTENT_URI = Uri.parse(CONTENT_URI_STRING);

        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 1;
    }

    public static abstract class AladinTable {
        public static final String RESOURCE = "aladin";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/" + RESOURCE;
        public static final Uri CONTENT_URI = Uri.parse(CONTENT_URI_STRING);


        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 2;

        public static final String CATEGORY_TEMPERATURE = "cz.martindobias.aladin.TEMPERATURE";
        public static final String CATEGORY_PRECIPITATION = "cz.martindobias.aladin.PRECIPITATION";
        public static final String CATEGORY_WIND = "cz.martindobias.aladin.WIND";
        public static final String CATEGORY_NEBULAE = "cz.martindobias.aladin.NEBULAE";

        public static final Set<String> ALADIN_CATEGORIES;

        static {
            ALADIN_CATEGORIES = new HashSet<String>();
            ALADIN_CATEGORIES.add(CATEGORY_TEMPERATURE);
            ALADIN_CATEGORIES.add(CATEGORY_PRECIPITATION);
            ALADIN_CATEGORIES.add(CATEGORY_WIND);
            ALADIN_CATEGORIES.add(CATEGORY_NEBULAE);
        }
    }

    public static interface BitmapTable {
        public static final String RESOURCE = "bitmap/*";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/bitmap/";

        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 3;
    }

    public static interface PrebaTable {
        public static final String RESOURCE = "preba";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/" + RESOURCE;
        public static final Uri CONTENT_URI = Uri.parse(CONTENT_URI_STRING);

        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 4;

        public static final String CATEGORY_PREBA = "cz.martindobias.aladin.PREBA";
    }

    public static interface RadarTable {
        public static final String RESOURCE = "radar";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/" + RESOURCE;
        public static final Uri CONTENT_URI = Uri.parse(CONTENT_URI_STRING);

        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 5;

        public static final String CATEGORY_RADAR = "cz.martindobias.aladin.RADAR";
        public static final String CATEGORY_RADAR_BASE = "cz.martindobias.aladin.RADAR_BASE";
        public static final String CATEGORY_RADAR_OVERLAY = "cz.martindobias.aladin.RADAR_OVERLAY";
    }

    public static interface VisirTable {
        public static final String RESOURCE = "visir";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/" + RESOURCE;
        public static final Uri CONTENT_URI = Uri.parse(CONTENT_URI_STRING);

        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 6;

        public static final String CATEGORY_VISIR = "cz.martindobias.aladin.VISIR";
        public static final String CATEGORY_VISIR_OVERLAY = "cz.martindobias.aladin.VISIR_OVERLAY";
    }

    public static interface PPTable {
        public static final String RESOURCE = "pp";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/" + RESOURCE;
        public static final Uri CONTENT_URI = Uri.parse(CONTENT_URI_STRING);

        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 7;

        public static final String CATEGORY_PP = "cz.martindobias.aladin.PP";
    }

    public static interface CountyTable {
        public static final String RESOURCE = "county/*";
        public static final String CONTENT_URI_STRING = "content://" + AUTHORITY + "/county/";

        public static final String CONTENT_TYPE = AUTHORITY + "/" + RESOURCE;
        public static final int TYPE = 8;
    }
}
